<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    *{margin: 0;padding: 0}
    li{
        list-style: none;
        display: inline-block;
        line-height: 50px;
        cursor: pointer;
    }
    .form{
        width: 300px;height: 40px;
        border: 1px solid #333;
        text-align: center;
        margin-left: 20px;
    }
    ul{
        height: 50px;
    }
    .content{
        height: 350px;
        position: relative;
        border: 1px solid #233333;      
    }
    .content>div{
        position: absolute;
        width: 100%;height: 100%;
        margin-top: 20px;
    }
    input{
        width: 275px;height: 36px;
        border: 1px solid #E0E0E0;
        margin-bottom: 24px;
        padding: 5px;
    }
    button{
        width: 275px;
        border: none;
        background-color: #EF5B00;
        color: white;
        padding: 13px;
    }
    .online{
        float: left;
        margin-left: 12px;
    }
    .online>a{
        text-decoration: none;
        color: #EF5B00;
        font-size: 12px;
    }
    .forget{
        float: right;
        margin-right: 12px;
    }
    .forget>a{
        text-decoration: none;
        color: #999999;
        font-size: 12px;
    }
    .forget>p{
        color: #999999;
        font-size: 12px;
        display: inline;
    }
    .forget>a:hover{
        color: #EF5B00;
    }
    .two{
        display: none;
    }
    .current{
        color: tomato;
    }
    </style>
</head>
<body>
    <div class="form">
        <ul>
            <li class="current">账号登录</li>
            <li>扫码登录</li>
        </ul>
        <div class="content">
            <div class="one">
                <input type="text" placeholder="邮箱/手机号码/小米ID">
                <input type="text" placeholder="密码">
                <button>登录</button>
                <div class="online">
                    <a href="">手机短信登录/注册</a>
                </div>
                <div class="forget">
                    <a href="">立即注册</a>
                    <p>|</p>
                    <a href="">忘记密码?</a>
                </div>
            </div>
            <div class="two">
                <img src="images/01.png" alt="">
            </div>
        </div>
    </div>
    <script>
        var lis =document.getElementsByTagName("li");
        var contents=document.querySelectorAll(".content>div");
        for(let i=0;i<lis.length;i++){
            lis[i].onclick=function(){
                for(var k=0;k<lis.length;k++){
                    lis[k].className="";
                }
                this.className="current";
                for(let i=0;i<contents.length;i++){
                    contents[i].style.display="none";
                }
                contents[i].style.display="block";
            }
        }
    </script>
</body>
</html>